//
//  TestDataManager.m
//  SWIOSLibary
//
//  Created by shaowei on 13-7-19.
//  Copyright (c) 2013年 LianZhan. All rights reserved.
//

#import "TestDataManager.h"

@implementation TestDataManager

+ (NSArray *)getImageUrlArray{
    
    return [TestDataManager getImageUrlWithNum:0];
}

+ (NSArray *)getImageUrlWithNum:(int)urlNum{
    
    NSError *error = nil;
    NSString *path = [SWBundleUtil pathForResource:@"PictureURL" ofType:BundleResourceOfFile];
    NSString *urlString = [NSString stringWithContentsOfFile:path
                                                    encoding:NSUTF8StringEncoding
                                                       error:&error];
    if (error) {
        DLog(@"SW - error:%@",error.description);
    }
    
    NSArray *imageUrlArray = [urlString componentsSeparatedByString:@",\n"];
    NSArray *resultArray = nil;
    if ((urlNum <= 0) || (urlNum > [imageUrlArray count])) {
        resultArray = imageUrlArray;
    }else{
        resultArray = [imageUrlArray subarrayWithRange:NSMakeRange(0, urlNum)];
    }
    
    return resultArray;
}

@end
